import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:yqmssa_app/request/http_path.dart';
import 'package:yqmssa_app/request/my_request.dart';

class FeedbackManager extends GetxController {
  final content = TextEditingController();
  final contact = TextEditingController();

  putFeedback() {
    if (content.text.isEmpty) {
      SmartDialog.showToast("请输入反馈内容");
      return;
    }
    SmartDialog.showLoading(msg: "正在提交...");
    MyRequest().dioReq(HttpPath.complaintApp, data: {"content": content.text, "attach": "", "contact": contact.text}).then((value) {
      SmartDialog.dismiss();
      SmartDialog.showToast("提交成功");
      Get.back();
    }, onError: (err) {
      SmartDialog.showToast(err.message);
    });
  }
}
